﻿using System;
using System.Collections.Generic;
using System.Text;
using AspNetCs.IDAL;
using AspNetCs.DALFactory;
using AspNetCs.Model;
using System.Data;

namespace AspNetCs.Bll
{
    public class Cemetery_AddNumId
    {
        private ICemetery_AddNumId CreateAddNumid = Conn.CreateCemetery_AddNumId();

        public int Add(Cemetery_AddNumId_Model md)
        {
            int Result = 0;
            if (md == null) return -1;
            Result = CreateAddNumid.Add(md);
            return Result;

        }
        public Cemetery_AddNumId_Model GetModel(int id)
        {
            Cemetery_AddNumId_Model md = new Cemetery_AddNumId_Model();

            try
            {
                md = CreateAddNumid.GetModel(CreateAddNumid.GetDataTable(" id=" + id).Rows[0]);
            }
            catch
            {
                md = null;
            }
            return md;
        }

        public Cemetery_AddNumId_Model GetModel(DataRow dr)
        {
            Cemetery_AddNumId_Model md = new Cemetery_AddNumId_Model();

            try
            {
                md = CreateAddNumid.GetModel(dr);
            }
            catch
            {
                md = null;
            }
            return md;
        }

        public List<Cemetery_AddNumId_Model> GetData(string filter)
        {
            return CreateAddNumid.GetData(filter);
        }

        public int Update(string Upfilter, string filter)
        {
            return CreateAddNumid.Update(Upfilter, filter);
        }

        public int delete(string filter)
        {
            if (filter == "") return -1;
            return CreateAddNumid.delete(filter);
        }




    }
}
